package com.gao.controller;

import java.util.Arrays;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.gao.entity.Jf3EquipmentEntity;
import com.gao.service.Jf3EquipmentService;
import com.gao.common.utils.PageUtils;
import com.gao.common.utils.R;



/**
 * 
 *
 * @author gao
 * @email sunlightcs@gmail.com
 * @date 2021-04-06 21:18:25
 */
@RestController
@RequestMapping("/jf3equipment")
public class Jf3EquipmentController {
    @Autowired
    private Jf3EquipmentService jf3EquipmentService;

    /**
     * 列表
     */
    @RequestMapping("/list")
    public R list(@RequestParam Map<String, Object> params){
        PageUtils page = jf3EquipmentService.queryPage(params);

        return R.ok().put("page", page);
    }


    /**
     * 信息
     */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") Integer id){
		Jf3EquipmentEntity jf3Equipment = jf3EquipmentService.getById(id);

        return R.ok().put("jf3Equipment", jf3Equipment);
    }

    /**
     * 保存
     */
    @RequestMapping("/save")
    public R save(@RequestBody Jf3EquipmentEntity jf3Equipment){
		jf3EquipmentService.save(jf3Equipment);

        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    public R update(@RequestBody Jf3EquipmentEntity jf3Equipment){
		jf3EquipmentService.updateById(jf3Equipment);

        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    public R delete(@RequestBody Integer[] ids){
		jf3EquipmentService.removeByIds(Arrays.asList(ids));

        return R.ok();
    }

}
